Shader "Level4/Laser/SimpleLaser" {
	Properties {
		_MainTex ("Base (RGB)", 2D) = "white" {}
		_NoiseTex("Noise Tex",2d) = ""{}
		_Alpha("Alpha",float) = 1
	}
	
	CGINCLUDE
	#include "UnityCG.cginc"
	
	sampler2D _MainTex;
	sampler2D _NoiseTex;
	float _Alpha;
	
	half4 _MainTex_ST;
	half4 _NoiseTex_ST;
	
	struct v2f{
		float4 pos:POSITION;
		float4 uv:TEXCOORD;
	};
	
	v2f vert(appdata_base i){
		v2f o;
		o.pos = mul(UNITY_MATRIX_MVP,i.vertex);
		
		o.uv.xy = TRANSFORM_TEX(i.texcoord,_MainTex);
		o.uv.zw = TRANSFORM_TEX(i.texcoord,_NoiseTex);

		o.uv.x -= _Time.x;
		o.uv.x = 1.0 - o.uv.x;
		o.uv.z -= _Time.y;
		return o;
	}
	
	float4 frag(v2f i):COLOR{
		float4 c = tex2D(_MainTex,i.uv.xy) * tex2D(_NoiseTex,i.uv.zw);
		c.a *= _Alpha;
		return c;
	}
	
	ENDCG
	
	SubShader {
		Tags { "RenderType"="Opaque" }
		LOD 200
		zwrite off
		blend srcAlpha one

		pass{
			CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag
			ENDCG
		}
	}
	FallBack "Diffuse"
}
